

import java.util.ArrayList;

import logic.MySQLconnection;
import fit.ActionFixture;
import gui.AcademicFrame;
import gui.ServerGui;


public class SetAssessmentDuration extends ActionFixture
{
	String request;
	String days;
	String newStatus;
	
	ServerGui server;
	AcademicFrame client;
	
	public void setupfixture()
	{
		server = new ServerGui();
		server.fakeServer(5555, "mysql://localhost/test", "root", "Braude");
		server.myLog.setVisible(false);
		client = new AcademicFrame("Localhost",5555);
		
	}

	
	public void setRequestNumber (String rid)
	{
		request = rid;
	}
	
	public void setDaysForAssessment (String numberOfDays)
	{
		days = numberOfDays;
	}
	
	public void setStatus()
	{
		newStatus = "3";
	}
	
	public boolean setTaskDuration ()
	{
			
		ArrayList<Object> question = new ArrayList<Object>();
		ArrayList<Object> answer = new ArrayList<Object>();
		
		question.add("setTaskDuration");
		question.add(request);
		question.add(days);
		question.add(newStatus);
	
		client.myclient.sendMessageToServer(question);
		while (client.answer==null);
		answer = client.answer;
		client.answer=null;
		
		if ( ((String)(answer.get(1))).equalsIgnoreCase("TaskDurationSet") )
			return true;
		else
			return false;
	}
			
	  

}
